{include file="public/layout" /}
<style type="text/css">
.yes {
    color: #1BBC9D;
    cursor: default;
}
</style>
<nav class="breadcrumb">
	<i class="Hui-iconfont">&#xe67f;</i> 首页 
	<span class="c-gray en">&gt;</span> 系统管理 
	<span class="c-gray en">&gt;</span> 广告列表
	<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="page-container" style="margin-top: 20px;">
	<div class="cl pd-5 bg-1 bk-gray">
		<span class="l"><a class="btn btn-primary radius" href="/Admin/ad/ad_info"><i class="Hui-iconfont">&#xe600;</i> 添加广告</a> </span> 
		<span class="r">共有数据：<strong>{$count}</strong> 条</span> 
	</div>
	<table class="table table-border table-bordered table-hover table-bg">
		<thead>
			<tr>
				<th scope="col" colspan="8">广告列表</th>
			</tr>
			<tr class="text-c">
				<th width="25"><input type="checkbox" value="" name=""></th>
				<th width="40">ID</th>
				<th width="200">广告位置</th>
				<th width="200">广告名称</th>
				<th width="200">广告图片</th>
				<th width="200">显示</th>
				<th width="200">排序</th>
				<th width="70">操作</th>
			</tr>
		</thead>
		<tbody>
			{foreach name="list" item="vo" key="k" }
			<tr class="text-c">
				<td><input type="checkbox" value="" name=""></td>
				<td>{$vo.ad_id}</td>
				<td>{$vo.position_name}</td>
				<td>{$vo.ad_name}</td>
				<td><img src="{$vo.ad_code}" width="60" height="60"></td>
				<td><span class="yes">{if $vo.enabled == 0}否{else /}是{/if}</span></td>
				<td>{$vo.orderby}</td>
				<td class="f-14"><a title="编辑" href="/Admin/ad/ad_info?ad_id={$vo.ad_id}" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a> <a title="删除" href="javascript:;" onclick="del(this)" data-url="/Admin/ad/del" data-id="{$vo.ad_id}" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i></a></td>
			</tr>
			{/foreach}
		</tbody>
	</table>
	 <div>{$list->render()|raw}</div>
</div>
{include file="public/footer" /}
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/public/h-ui.admin/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript">
/*删除*/
function del(obj){
	layer.confirm('删除须谨慎，确认要删除吗？',function(index){
		$.ajax({
			type: 'POST',
			url: $(obj).attr('data-url'),
			data:{id: $(obj).attr('data-id')},
			dataType: 'json',
			success: function(data){
				$(obj).parents("tr").remove();
				layer.msg('已删除!',{icon:1,time:1000});
			},
			error:function(data) {
				console.log(data.msg);
			},
		});		
	});
}
</script>
</body>
</html>